from tkinter.font import names
# -*- coding: utf-8 -*-


class Person:
    def __init__(self,name,age):
        self.name=name
        self.age = age
    def show(self):
        print(f'大家好我叫:{self.name},我今年:{self.age}岁')

#student继承person类
class Student(Person):
    def __init__(self,name,age,stuno):
        super().__init__(name,age)
        self.stuno=stuno

#doctor继承person类
class Doctor (Person):
    def __init__(self,name,age,department):
        super().__init__(name,age)
        self.department=department

#子类对象
stu=Student('陈梅梅',20,'女')
stu.show()





#多继承
class FatherA():
    def __init__(self,name):
        self.name = name
    def showA(self):
        print('父类A方法')
class FatherB():
    def  __init__(self,age):
        self.age = age
    def showB(self):
        print('父类B的方法')


class Son(FatherB,FatherA):
    def __init__(self,name,age,gender):
        FatherA.__init__(self,name)
        FatherB.__init__(self,age)

        self.gender=gender


son=Son('陈梅梅',20,'女')
son.showA()
son.showB()